package com.zqh.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.ibatis.javassist.runtime.Desc;

import java.util.Date;

@Data
@Schema(description = "用户实体类")
public class User {
    @Schema(description = "id")
    private Long id;

    @Schema(description = "用户名")
    private String username;

    @JsonIgnore//不参与json序列化
    @Schema(description = "加密后的密码")
    private String password;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "电话号码")
    private String phoneNum;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "性别 0女，1男，2保密")
    private Byte gender;

    @JsonIgnore // 不参与JSON序列化
    @Schema(description = "盐值")
    private String salt;

    @Schema(description = "头像地址")
    @JsonInclude(JsonInclude.Include.ALWAYS) //强制参与序列化
     private String avatarUrl;

    @Schema(description = "发帖数量")
    private Integer articleCount;

    @Schema(description = "是否管理员 0否,1是")
    private Byte isAdmin;

    @Schema(description = "个人简介")
    private String remark;

    @Schema(description = "用户状态 0正常,1禁言")
    private Byte state;

    @JsonIgnore // 不参与JSON序列化
    @Schema(description = "是否删除 0否,1是")
    private Byte deleteState;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;
}